package com.github.cyf.context;

/**
 * @author chenyifan
 * @create 2024-04-15 15:19
 */
public class SecurityUtil {

    private static final ThreadLocal<Long> TENANT_LOCAL = new ThreadLocal<>();

    public static Long getTenantId() {
        return TENANT_LOCAL.get();
    }

    public static void setTenantId(Long id) {
        TENANT_LOCAL.set(id);
    }

    public static void clearTenantId() {
        TENANT_LOCAL.remove();
    }
}
